package nsoft.swing.demo;

import java.awt.BorderLayout;
import java.awt.GridLayout;

import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class DisplayEngine extends JFrame {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private static JFrame frame;

	public static void startEngine() {
		frame = new JFrame("Swingets Demo");
		frame.getContentPane().setLayout(new BorderLayout());
		frame.setSize(500, 500);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);
	}
	
	public static void show(JComponent component){
		//frame.removeAll();
		JPanel panel = new JPanel(new GridLayout());
		panel.add(component);
		frame.setContentPane(panel);
		frame.pack();
	}
	
}
